package com.youbug.mall.member_ums.feign.impl;

import com.youbug.common.vo.MemberAddressVo;
import com.youbug.mall.member_ums.entity.UmsMemberReceiveAddress;
import com.youbug.mall.member_ums.service.IUmsMemberReceiveAddressService;
import com.youbug.mall.ware_wms.feign.IWareMemberFeignService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WareMemberFeignServiceImpl implements IWareMemberFeignService {

    @Autowired
    private IUmsMemberReceiveAddressService umsMemberReceiveAddressService;

    @Override
    public MemberAddressVo addrInfo(Long addrId) {

        UmsMemberReceiveAddress receiveAddress = umsMemberReceiveAddressService.getById(addrId);

        if(receiveAddress!=null){
            MemberAddressVo addressVo = new MemberAddressVo();

            BeanUtils.copyProperties(receiveAddress, addressVo);

            return addressVo;
        }

        return null;
    }
}
